package com.zhanglinfeng.api.service;

import com.zhanglinfeng.api.config.FeignClientConfig;
import com.zhanglinfeng.api.entity.UserEntity;
import com.zhanglinfeng.api.response.ResultResponse;
import com.zhanglinfeng.api.service.impl.LoginFeignImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


/**
 * name：指定提供者的名字
 * fallback：降级处理类
 * configuration：替换默认的配置
 */
@FeignClient(name = "authorization-client", fallback = LoginFeignImpl.class, configuration = {FeignClientConfig.class})
public interface LoginFeign {

    @PostMapping(value = "/login", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
    ResultResponse<String> login(@RequestBody UserEntity user);
}
